import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import springIoc.test03.springbean.BeanClass;

/**
 * 测试prototype作用域
 * springIoc.test03.springbean.BeanClass@42607a4f
 * springIoc.test03.springbean.BeanClass@782663d3
 * 每次都会创建一个新的bean实例
 */
public class protoypetest {
    @Test
    public void test1() throws Exception {
        /**
         * signlet智慧实例化一个bean
         */
        ApplicationContext applicationContext =new ClassPathXmlApplicationContext("spring.xml");
        BeanClass singletontest1 = (BeanClass) applicationContext.getBean("test042");
        System.out.println(singletontest1);
        BeanClass singletontest2 = (BeanClass) applicationContext.getBean("test042");
        System.out.println(singletontest2);
    }
}
